<?php

namespace app\product\controller;
use app\common\controller\PCBase;
use app\common\controller\DBase;
use app\common\library\Upload;
use app\common\service\CommonExportInfoDetailService;
use app\product\logic\ProductOutLogic;
use app\systems\logic\MqTaskServiceLogic;
use  think\App;
class ProductOut extends PCBase
{

    /**
     * @desc   获取海外仓库列表
     * @author luckyXiong
     * @date   2024-08-02
     */
    public function index(){
        $params     = $this->request->post();
        return  (new ProductOutLogic())->getList($params);
    }


    /**
     * @desc   获取spu详细数据
     * @author luckyXiong
     * @date   2024-08-06
     */
    public function getSpuInfo(){
        $params     = $this->request->post();
        return  (new ProductOutLogic())->getSpuInfo($params);
    }





    /**
     * @desc   获取海外仓库数据
     * @author luckyXiong
     * @date   2024-08-02
     */
    public function getWarehouse(){
        $params     = $this->request->post();
        return  (new ProductOutLogic())->get_warehouse($params);
    }


    /**
     * @desc   获取海外仓库数据
     * @author luckyXiong
     * @date   2024-08-02
     */
    public function uploadInfo(){
        $file         = $this->request->file('file');
        $res          = (new Upload($file))->upload(null, $this->getAdminId());
        (new ProductOutLogic())->import_jinyi($res['url']);
        return  $this->jsonMessage(200, true, '操作成功',null);
    }


    /**
     * @desc   测试导出数据
     * @author luckyXiong
     * @date   2024-08-07
     */
    public function link_export(){
        $params     = $this->request->post();
        $params['create_work_num'] = $this->getAdminTel();
        return  (new ProductOutLogic())->link_export($params);
   }


    /**
     * @desc   获取海外仓库数据
     * @author luckyXiong
     * @date   2024-08-08
     */
    public function test_export(){
        $params   = $this->request->post();
        $res      = (new CommonExportInfoDetailService())->createCsvInfo($params);
        return  $this->jsonMessage(200, true, '操作成功',$res);
    }


    /**
     * @desc   导出海外仓数据
     * @author luckyXiong
     * @date   2025-04-16
     */
    public function export_hwc(){
        $params   = $this->request->post();
        $res      = (new ProductOutLogic())->export_hwc($params);
        return  $this->jsonMessage(200, true, '操作成功','');
    }






}